package zut.edu.cs.network.io.buffer;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class BufferWriterDemo {

	public static void main(String[] args) {
		
		String[] strings = {"明日复明日","明日何其多","我生待明日","万事成蹉跎"};
		File file = new File("test.txt");
		FileWriter fw;
		try {
			fw = new FileWriter(file);
			BufferedWriter bw =new BufferedWriter(fw);
			for (String string : strings) {
				bw.write(string);
				bw.write("\n");
			}
//		奖缓冲区中的内容写到外存
			bw.flush();
			bw.close();
			fw.close();
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		

	}

}
